class ClientMailer < ActionMailer::Base
  # 2 variation of welcome letter with/without credit card data
  def registration(user, subscription, application, trial_period = nil)
    @subject    = "Welcome to #{application.name}"
    @body       = { :user => user
                    :application => application,
                    :trial_period => trial_period,
                    :expiration_date => strfdate_short(subscription.expires_at),

                    :site_to_help => "#{application.url}/helps",
                    :site_account => "#{application.url}/settings/accounts/",
                    :help_email => "help@zepinvest.com",
                    :update_email => "updates@zepinvest.com"}
    @recipients = user.email
    @from       = "updates@zepinvest.com"
    @sent_on    = Time.now
  end

  # 2 variation of subscription trial reminder letter with/without credit card data
  def subscription_trial_reminder(user, application, subscription, bundle, bundle_variation, trial_period)
    @subject    = "#{application.name} subscription reminder"
    @body       = { :application => application,
                    :expiration_date => strfdate_short(subscription.expires_at),
                    :bundle => bundle,
                    :bundle_variation => bundle_variation,
                    :trial_period => trial_period,

                    :site_to_visit => "#{application.url}/settings/accounts/",
                    :help_email => "help@zepinvest.com"}
    @recipients = user.email
    @from       = "updates@zepinvest.com"
    @sent_on    = Time.now
  end

  # reset password
  def reset_password(user, application, url)
    @subject    = "#{application.name} Password reset"
    @body       = { :application => application,
                    :url_reset_password => url}
    @recipients = user.email
    @from       = "updates@zepinvest.com"
    @sent_on    = Time.now
  end



  # @bcc        = "help@zepinvest.com"
  # @content_type = 'text/html'
  
  # attachment "application/rtf" do |a|
  #   a.body = File.read 'some_file.rtf'
  #   a.filename = 'samples.rtf'
  # end
  

end
